import React, { Component } from 'react'

import {getDatas} from '../../../utils/tools';
import {COURSE_TH} from '../../../config/table_config';

import CourseService from '../../../services/course';

import ListTitle from '../../../components/common/ListTitle';
import TableTh from '../../../components/common/TableTh'

import './index.scss'

const courseService = new CourseService();

export default class Course extends Component {
    constructor(props){
        super(props);
        this.state={
            title:'课程管理'
        }
    }
    async getCourseData(){
        const result = await courseService.getCourseData(),
              errorCode = result.error_code,
              data = result.data,
              {history} = this.props;
              getDatas(errorCode,data,history,()=>{
                  console.log(data);
              })
    }
    componentDidMount(){
        this.getCourseData()
    }
    render() {
        return (
            <div>
               <ListTitle></ListTitle>
               <TableTh title></TableTh>
            </div>
        )
    }
}
